﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace Utility.Model
{
    /// <summary>
    /// 用户实体
    /// </summary>
    [Serializable]
    public class Sys_User : Entity
    {
        /// <summary>
        /// 用户实体
        /// </summary>
        public Sys_User()
            : base("Sys_User")
        {
            this._UserID = Guid.NewGuid().ToString();
            this._IsDelete = false;
            this._CreateDate = Utility.ConvertHelper.GetNowDateTime();
            this._UserTypeName = "GeneralTeacher";
        }


        #region Model
        private string _UserID;
        private string _Name;
        private string _DeptGuID;
        private string _UserName;
        private string _Password;
        private bool? _IsDelete;
        private DateTime? _CreateDate;
        private string _CreateUser;
        private bool? _IsAdmin;
        private string _Mobile;
        private string _Email;
        private string _RtxLoginName;
        private string _WebChat;
        private string _QQ;
        private DateTime? _BirthDay;
        private string _Code;
        private string _UserTypeName;
        /// <summary>
        /// 
        /// </summary>
        public string UserID
        {
            get { return _UserID; }
            set
            {
                this.OnPropertyValueChange(_.UserID, _UserID, value);
                this._UserID = value;
            }
        }
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name
        {
            get { return _Name; }
            set
            {
                this.OnPropertyValueChange(_.Name, _Name, value);
                this._Name = value;
            }
        }
        /// <summary>
        /// 所属部门
        /// </summary>
        public string DeptGuID
        {
            get { return _DeptGuID; }
            set
            {
                this.OnPropertyValueChange(_.DeptGuID, _DeptGuID, value);
                this._DeptGuID = value;
            }
        }
        /// <summary>
        /// 登录名
        /// </summary>
        public string UserName
        {
            get { return _UserName; }
            set
            {
                this.OnPropertyValueChange(_.UserName, _UserName, value);
                this._UserName = value;
            }
        }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password
        {
            get { return _Password; }
            set
            {
                this.OnPropertyValueChange(_.Password, _Password, value);
                this._Password = value;
            }
        }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDelete
        {
            get { return _IsDelete; }
            set
            {
                this.OnPropertyValueChange(_.IsDelete, _IsDelete, value);
                this._IsDelete = value;
            }
        }
        /// <summary>
        /// 日期
        /// </summary>
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set
            {
                this.OnPropertyValueChange(_.CreateDate, _CreateDate, value);
                this._CreateDate = value;
            }
        }
        /// <summary>
        /// 创建用户
        /// </summary>
        public string CreateUser
        {
            get { return _CreateUser; }
            set
            {
                this.OnPropertyValueChange(_.CreateUser, _CreateUser, value);
                this._CreateUser = value;
            }
        }
        /// <summary>
        /// 是否管理员
        /// </summary>
        public bool? IsAdmin
        {
            get { return _IsAdmin; }
            set
            {
                this.OnPropertyValueChange(_.IsAdmin, _IsAdmin, value);
                this._IsAdmin = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Mobile
        {
            get { return _Mobile; }
            set
            {
                this.OnPropertyValueChange(_.Mobile, _Mobile, value);
                this._Mobile = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Email
        {
            get { return _Email; }
            set
            {
                this.OnPropertyValueChange(_.Email, _Email, value);
                this._Email = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string RtxLoginName
        {
            get { return _RtxLoginName; }
            set
            {
                this.OnPropertyValueChange(_.RtxLoginName, _RtxLoginName, value);
                this._RtxLoginName = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string WebChat
        {
            get { return _WebChat; }
            set
            {
                this.OnPropertyValueChange(_.WebChat, _WebChat, value);
                this._WebChat = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string QQ
        {
            get { return _QQ; }
            set
            {
                this.OnPropertyValueChange(_.QQ, _QQ, value);
                this._QQ = value;
            }
        }
        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? BirthDay
        {
            get { return _BirthDay; }
            set
            {
                this.OnPropertyValueChange(_.BirthDay, _BirthDay, value);
                this._BirthDay = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string Code
        {
            get { return _Code; }
            set
            {
                this.OnPropertyValueChange(_.Code, _Code, value);
                this._Code = value;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string UserTypeName
        {
            get { return _UserTypeName; }
            set
            {
                this.OnPropertyValueChange(_.UserTypeName, _UserTypeName, value);
                this._UserTypeName = value;
            }
        }
        #endregion

        #region Method
        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        public override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
                _.UserID};
        }
        /// <summary>
        /// 获取列信息
        /// </summary>
        public override Field[] GetFields()
        {
            return new Field[] {
                _.UserID,
                _.Name,
                _.DeptGuID,
                _.UserName,
                _.Password,
                _.IsDelete,
                _.CreateDate,
                _.CreateUser,
                _.IsAdmin,
                _.Mobile,
                _.Email,
                _.RtxLoginName,
                _.WebChat,
                _.QQ,
                _.BirthDay,
                _.Code,
                _.UserTypeName};
        }
        /// <summary>
        /// 获取值信息
        /// </summary>
        public override object[] GetValues()
        {
            return new object[] {
                this._UserID,
                this._Name,
                this._DeptGuID,
                this._UserName,
                this._Password,
                this._IsDelete,
                this._CreateDate,
                this._CreateUser,
                this._IsAdmin,
                this._Mobile,
                this._Email,
                this._RtxLoginName,
                this._WebChat,
                this._QQ,
                this._BirthDay,
                this._Code,
                this._UserTypeName};
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(IDataReader reader)
        {
            this._UserID = DataUtils.ConvertValue<string>(reader["UserID"]);
            this._Name = DataUtils.ConvertValue<string>(reader["Name"]);
            this._DeptGuID = DataUtils.ConvertValue<string>(reader["DeptGuID"]);
            this._UserName = DataUtils.ConvertValue<string>(reader["UserName"]);
            this._Password = DataUtils.ConvertValue<string>(reader["Password"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(reader["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(reader["CreateUser"]);
            this._IsAdmin = DataUtils.ConvertValue<bool?>(reader["IsAdmin"]);
            this._Mobile = DataUtils.ConvertValue<string>(reader["Mobile"]);
            this._Email = DataUtils.ConvertValue<string>(reader["Email"]);
            this._RtxLoginName = DataUtils.ConvertValue<string>(reader["RtxLoginName"]);
            this._WebChat = DataUtils.ConvertValue<string>(reader["WebChat"]);
            this._QQ = DataUtils.ConvertValue<string>(reader["QQ"]);
            this._BirthDay = DataUtils.ConvertValue<DateTime?>(reader["BirthDay"]);
            this._Code = DataUtils.ConvertValue<string>(reader["Code"]);
            this._UserTypeName = DataUtils.ConvertValue<string>(reader["UserTypeName"]);
        }
        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        public override void SetPropertyValues(DataRow row)
        {
            this._UserID = DataUtils.ConvertValue<string>(row["UserID"]);
            this._Name = DataUtils.ConvertValue<string>(row["Name"]);
            this._DeptGuID = DataUtils.ConvertValue<string>(row["DeptGuID"]);
            this._UserName = DataUtils.ConvertValue<string>(row["UserName"]);
            this._Password = DataUtils.ConvertValue<string>(row["Password"]);
            this._IsDelete = DataUtils.ConvertValue<bool?>(row["IsDelete"]);
            this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
            this._CreateUser = DataUtils.ConvertValue<string>(row["CreateUser"]);
            this._IsAdmin = DataUtils.ConvertValue<bool?>(row["IsAdmin"]);
            this._Mobile = DataUtils.ConvertValue<string>(row["Mobile"]);
            this._Email = DataUtils.ConvertValue<string>(row["Email"]);
            this._RtxLoginName = DataUtils.ConvertValue<string>(row["RtxLoginName"]);
            this._WebChat = DataUtils.ConvertValue<string>(row["WebChat"]);
            this._QQ = DataUtils.ConvertValue<string>(row["QQ"]);
            this._BirthDay = DataUtils.ConvertValue<DateTime?>(row["BirthDay"]);
            this._Code = DataUtils.ConvertValue<string>(row["Code"]);
            this._UserTypeName = DataUtils.ConvertValue<string>(row["UserTypeName"]);
        }
        #endregion

        #region _Field
        /// <summary>
        /// 字段信息
        /// </summary>
        public class _
        {
            /// <summary>
            /// * 
            /// </summary>
            public readonly static Field All = new Field("*", "Sys_User");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field UserID = new Field("UserID", "Sys_User", "UserID");
            /// <summary>
            /// 姓名
            /// </summary>
            public readonly static Field Name = new Field("Name", "Sys_User", "姓名");
            /// <summary>
            /// 所属部门
            /// </summary>
            public readonly static Field DeptGuID = new Field("DeptGuID", "Sys_User", "所属部门");
            /// <summary>
            /// 登录名
            /// </summary>
            public readonly static Field UserName = new Field("UserName", "Sys_User", "登录名");
            /// <summary>
            /// 密码
            /// </summary>
            public readonly static Field Password = new Field("Password", "Sys_User", "密码");
            /// <summary>
            /// 是否删除
            /// </summary>
            public readonly static Field IsDelete = new Field("IsDelete", "Sys_User", "是否删除");
            /// <summary>
            /// 日期
            /// </summary>
            public readonly static Field CreateDate = new Field("CreateDate", "Sys_User", "日期");
            /// <summary>
            /// 创建用户
            /// </summary>
            public readonly static Field CreateUser = new Field("CreateUser", "Sys_User", "创建用户");
            /// <summary>
            /// 是否管理员
            /// </summary>
            public readonly static Field IsAdmin = new Field("IsAdmin", "Sys_User", "是否管理员");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field Mobile = new Field("Mobile", "Sys_User", "Mobile");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field Email = new Field("Email", "Sys_User", "Email");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field RtxLoginName = new Field("RtxLoginName", "Sys_User", "RtxLoginName");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field WebChat = new Field("WebChat", "Sys_User", "WebChat");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field QQ = new Field("QQ", "Sys_User", "QQ");
            /// <summary>
            /// 生日
            /// </summary>
            public readonly static Field BirthDay = new Field("BirthDay", "Sys_User", "生日");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field Code = new Field("Code", "Sys_User", "Code");
            /// <summary>
            /// 
            /// </summary>
            public readonly static Field UserTypeName = new Field("UserTypeName", "Sys_User", "UserTypeName");
        }
        #endregion


    }
}



